package torres.map.tile;

import torres.entity.Entity;
import torres.item.Item;
import torres.map.effect.AreaEffect;

/**
 * @author Torres
 * Marks a Tile if AreaEffects are present
 */
@SuppressWarnings("serial")
public abstract class Decal implements Tile {
	private Tile tile;
	protected String imageName;
	
	/**
	 * Creates a new Decal that is applied to the specified Tile.
	 * @param tile The Tile to which this Decal is being applied.
	 */
	public Decal(Tile tile) {

		this.tile = tile;
	}
	
	
	/**
	 * Returns the Tile to which this Decal is attached.
	 * @return The Tile to which this Decal is attached.
	 */
	public Tile getTile(){
		
		return tile;
	}
	
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#addEntity(torres.entity.Entity)
	 */
	public void addEntity(Entity entity) {
		
		tile.addEntity(entity);
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#addItem(torres.item.Item)
	 */
	public void addItem(Item item) {
		
		tile.addItem(item);
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#addTerrain(torres.map.tile.Terrain)
	 */
	public void addTerrain(Terrain terrain) {
		
		tile.addTerrain(terrain);
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#addEffect(torres.map.effect.AreaEffect)
	 */
	public void addEffect(AreaEffect effect) {
		
		tile.addEffect(effect);
	} 
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#removeEntity()
	 */
	public void removeEntity() {
		
		tile.removeEntity();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#removeEffect()
	 */
	public void removeEffect() {
		
		tile.removeEffect();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#removeItem()
	 */
	public void removeItem() {
		
		tile.removeItem();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#getItem()
	 */
	public Item getItem() {
		
		return tile.getItem();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#getEntity()
	 */
	public Entity getEntity() {
		
		return tile.getEntity();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#getEffect()
	 */
	public AreaEffect getEffect() {
		
		return tile.getEffect();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#getTerrain()
	 */
	public Terrain getTerrain() {
		
		return tile.getTerrain();
	} 
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#getImageName()
	 */
	public String getImageName() {
		return tile.getImageName() + "|" + imageName;
	}
	
	/**
	 * Sets the image name of this Decal to the specified name.
	 * @param imageName The new image name for this Decal.
	 */
	public void setImageName(String imageName) {
		this.imageName = imageName;
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#hasEntity()
	 */
	public boolean hasEntity() {
		
		return tile.hasEntity();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#hasItem()
	 */
	public boolean hasItem() {
		
		return tile.hasItem();
	}
	
	/* (non-Javadoc)
	 * @see torres.map.tile.Tile#hasEffect()
	 */
	public boolean hasEffect() {
		
		return tile.hasEffect();
	}
}
